package org.xhy.hrm.domain;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author xhy
 * @since 2021-09-11
 */
@TableName("t_login_user")
@Data
public class LoginUser extends Model<LoginUser> {


    private static final long serialVersionUID = 1L;
    public static final Integer LOGIN_ADMIN = 1; //后台管理员
    public static final Integer LOGIN_USER = 0; //登录用户

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    private String username;
    private String password;
    private Integer type;

    @TableField("tenant_id")
    private Long tenantId;

    @TableField("company_name")
    private String companyName;

    @TableField("client_id")
    private String clientId;

    @TableField("client_secret")
    private String clientSecret;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "LoginUser{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", type=" + type +
                ", tenantId=" + tenantId +
                ", companyName='" + companyName + '\'' +
                ", clientId='" + clientId + '\'' +
                ", clientSecret='" + clientSecret + '\'' +
                '}';
    }
}
